<template>
    <s-m-s-record-table :loading="loading" :data="data"></s-m-s-record-table>
</template>

<script>
    import { getLoanedDetail } from '@/api/loaned'
    import SMSRecordTable from '@/components/Table/SMSRecord'

    export default {
        name: 'LoanedSMSRecord',
        components: { SMSRecordTable },
        watch: {
            id () {
                this.loading = true
                getLoanedDetail(this.id, { method: 'SMSRecord' }).then(res => {
                    const { result } = res
                    this.data = result
                }).finally(() => {
                    this.loading = false
                })
            }
        },
        data () {
            return {
                id: null,
                data: [],
                loading: false
            }
        },
        activated () {
            this.id = this.$route.query.id
        },
        created () {
            this.id = this.$route.query.id
        }
    }
</script>

<style scoped>

</style>
